import request from '@/utils/request'

// 获取订单列表
export function getOrderList(params) {
  return request({
    url: '/order/list',
    method: 'get',
    params
  })
}

// 获取订单详情
export function getOrderDetail(id) {
  return request({
    url: `/order/${id}`,
    method: 'get'
  })
}

// 更新订单状态
export function updateOrderStatus(data) {
  return request({
    url: '/order/status',
    method: 'post',
    data
  })
}

// 订单发货
export function shipOrder(data) {
  return request({
    url: '/order/ship',
    method: 'post',
    data
  })
}

// 处理退款申请
export function handleRefund(data) {
  return request({
    url: '/order/refund',
    method: 'post',
    data
  })
}

// 导出订单
export function exportOrders(params) {
  return request({
    url: '/order/export',
    method: 'get',
    params,
    responseType: 'blob'
  })
} 